package com.mentalhealthplatform.global.elasticsearch;

import com.mentalhealthplatform.appModels.Lecture;
import org.springframework.data.elasticsearch.annotations.Query;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface LectureElasticsearchRepository extends ElasticsearchRepository<Lecture, Long> {
    @Query("{\"match\": {\"text\": {\"query\": \"?0\", \"analyzer\": \"ik_smart\"}}}")
    List<Lecture> searchByText(String text);
}